from typing import List, Optional, Union

from pydantic import BaseModel


class AlterModelResult(BaseModel):
    ids: Optional[List[str]]
    created_num: Optional[int]
    modified_num: Optional[int]
    deleted_num: Optional[int]


class AggregateItem(BaseModel):
    term: Union[str, None]
    count: int


class AggregateResult(BaseModel):
    name: str
    items: Optional[List[AggregateItem]]
    count: Optional[int]
